package com.fulu.game.bi.controller.product;

import com.fulu.game.bi.entity.dto.EventAnalyseDetailListDTO;
import com.fulu.game.bi.entity.dto.EventListDTO;
import com.fulu.game.bi.entity.vo.Result;
import com.fulu.game.bi.service.impl.product.BehaviourEventDetailStatService;
import com.fulu.game.bi.service.impl.product.BehaviourEventStatService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 产品-事件分析
 */
@RestController
@RequestMapping("/api/product/event")
@Slf4j
public class EventAnalyseController {
    @Autowired
    private BehaviourEventStatService behaviourEventStatService;
    @Autowired
    private BehaviourEventDetailStatService behaviourEventDetailStatService;

    /**
     * 产品-事件分析-列表
     */
    @RequestMapping("/list")
    public Result list(EventListDTO eventListDTO) {
        return Result.success().data(behaviourEventStatService.list(eventListDTO));
    }

    /**
     * 产品-事件分析-列表-导出
     */
    @PostMapping("/export")
    public void listExport(EventListDTO eventListDTO) {
        behaviourEventStatService.listExport(eventListDTO);
    }


    /**
     * 产品-事件分析-列表详情
     */
    @RequestMapping("/list/detail")
    public Result listDetail(EventAnalyseDetailListDTO dto) {
        return Result.success().data(behaviourEventDetailStatService.listDetail(dto));
    }

    /**
     * 产品-事件分析-列表详情-导出
     */
    @PostMapping("/list/detail/export")
    public void listDetailExport(EventAnalyseDetailListDTO dto) {
        behaviourEventDetailStatService.listDetailExport(dto);
    }

}
